package com.ncp.model.biz.tools.common;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.jsp.jstl.sql.Result;

import com.ncp.model.dao.DB;
import com.ncp.model.dao.DbConnection;

public class UserTools {
	private DB common = new DB();
	public String getUserIdByLoginName(String userLoginName){
		String userID = "";
		String sql="select userID from USERBASIC where userLoginName = ? ";
		common.setSql(sql);
		common.setConn(DbConnection.getConnByDataSource());
		List<Object> list=new ArrayList<Object>();
		list.add(0, userLoginName);
		common.setList(list);
		Result rs = common.executeQuery();
		for(Map<String,Object> object: rs.getRows()){
			userID = object.get("USERID").toString();
		}
		return userID;
	}
}
